home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / as400 / commonvb / commonvb.txt
Encoding:
Text File  |  1995-12-24  |  38.3 KB  |  821 lines

  1. Sample VB AS/400 Client/Server Programs
  2.  
  3.   Copyright ⌐ 1995, 1996. Ron Jones.
  4.   Genesis Software, Inc.  All Rights Reserved.
  5.  
  6. This Document
  7.  
  8. At the Chicago COMMON (IBM Midrange-Users Group) I was asked, at the last 
  9. minute, to fill in for a missing presenter and give a session addressing using VB and 
  10. the AS/400 to create client/server applications. Although I have given many 
  11. presentations on the subject in the past; I was not scheduled to do so at Chicago. 
  12. Since I had only an hour to prepare for a 2 and 1/2 hour presentation I wanted to offer 
  13. every attendee a little something extra in case my presentation did not address some 
  14. of the topics that the original session would. So I told the audience that anyone who 
  15. dropped me an e-mail on Compuserve would receive information on how to get some 
  16. of sample VB code that was reviewed at the session.
  17.  
  18.   Unfortunately I was very busy directly after the conference while I completed my 
  19. book on the same subject. Since the book was released I had some time to fulfill my 
  20. promise and have completed putting together a few sample programs and information 
  21. and have uploaded them to various forums around CompuServe.
  22.  
  23.   If you like the sample programs included, you should buy a copy of the book. The 
  24. title is "Using Visual Basic With Client Access APIs". This 650+ page guide includes 
  25. two companion diskettes that contain over 35 projects and utilities. It covers topics 
  26. such as APPC, data queues, ODBC, OLE, SQL, and many others. You can contact 
  27. Duke Press (the NEWS/400 people) at 1-800-621-1544 for more information. If your 
  28. in the UK; contact Debbie Thorton at 44 161 929 0777. If you leave "down under"; 
  29. contact Melissa Hughes at 61 2891 9136. OK, enough with the sales pitch.
  30.  
  31.   If you are a COMMON member and want more of this kind of stuff (VB, Windows, 
  32. etc.) at COMMON conferences start yelling at the board and project leaders. Because 
  33. frankly I'm tired of trying to get sessions scheduled. Without exception every session 
  34. that I have ever done on the subject has been a "blow-out" and the reviews I received 
  35. later were outstanding. I'm not saying this to "bang" my own drum, but to point out 
  36. that there is a tremendous need for this stuff and you'll only have more sessions if you 
  37. scream and holler. OK, enough venting <g>.
  38.  
  39.   The remainder of this document contains information about the files that are 
  40. included in the COMMONVB.ZIP archive and other stuff. Please forgive me for any 
  41. spelling or grammar errors. I put these together at Christmas and was more 
  42. concerned about getting it out than making sure everything was just right.
  43.  
  44.   The information within this document is in no particular order and was included as an 
  45. aid to you in using the supplied sample programs and writing AS/400 CS applications 
  46. in general.
  47.  
  48. Disclaimer
  49.  
  50. Any information and/or code included within this document and/or the associated zip 
  51. archive are subject to change without notice. No warranty of any kind is made or 
  52. implied. There shall be no liability for errors contained herein or for incidental, special, 
  53. indirect, or consequential damages in connection with furnishing, performance, 
  54. content, or use of this material. Some material could contain technical inaccuracies or 
  55. typographical errors.
  56.  
  57. Required Files
  58.  
  59. The COMMONVB.ZIP does NOT contain the .VBX files (GRID, CMDIALOG) required 
  60. by a few of the programs provided. Neither does it contain the JET engine DLLs 
  61. required by the TRACKER application. If you have VB 3.0 you should already have 
  62. those files installed on your PC. Although the projects include are saved with VB 3.0; 
  63. they are completely compatible with VB 4.0.
  64.  
  65. How To Extract Files
  66.  
  67. The COMMONVB.ZIP was compressed using the 2.04 version of PKZIP and any 
  68. compatible ZIP utility should be able to unzip the file. The following steps should be 
  69. followed to replace and/or add the files to the directories.
  70.  
  71. 1. Download the COMMONVB.ZIP file to your personal computer.
  72.  
  73. 2. Create the directory to which you wish to install the files. The recommended name 
  74. is \GENESIS\AS400API. Using this naming convention will match the default used 
  75. with the book's companion diskettes.
  76.  
  77. 2. Place COMMONVB.ZIP file in the directory created.
  78.  
  79. 3. Use PKUNZIP (or some similar utility) to unzip the files as shown in the command 
  80. below:
  81.  
  82.     PKUNZIP -d COMMONVB.ZIP
  83.  
  84.       The -d optional causes the files to be restored to their original locations.
  85.  
  86. Smaller VB Font (ZZSMALL.FON)
  87.  
  88. One of the utility files provided is ZZSMALL.FON.
  89.  
  90.   If you are still using Visual Basic Version 3.0 or lower, within Windows 3.1, you have 
  91. no doubt been bothered by the font limitation in code editing windows. The 
  92. ZZSMALL.FON file lets you to overcome this limitation by providing a smaller font.
  93.  
  94.   To accomplish this change, after unzipping the COMMONVB.ZIP file, copy the 
  95. ZZSMALL.FON file found in the ..\ZZSMALL directory to your Windows system 
  96. directory (normally, C:\WINDOWS\SYSTEM). Then change the fixedfon.fon entry in 
  97. the [boot] section of your windows SYSTEM.INI file to the following value:
  98.  
  99.     fixedfon.fon=zzsmall.fon
  100.  
  101.   After saving the file and rebooting your system, both Visual Basic and the notepad 
  102. utility will use this smaller font, which will allow you to see more text within a single 
  103. screen.
  104.  
  105.   VB 4.0 provides multipoint fonts as a new feature and does away with the need to 
  106. use ZZSMALL.FON. ZZSMALL.FON does not work with Windows 95.
  107.  
  108. AS/400 Setup
  109.  
  110. The next few sections provide an overview of the steps required to create the AS/400 
  111. library and the objects in it. The library and the objects are needed to run some of the 
  112. programs provided. The books companion diskettes do all this stuff for you 
  113. automatically.
  114.  
  115.   (Note: Lines beginning with an asterisk ("*") are commands which must be executed 
  116. to properly setup the GENESIS library and other required objects.) 
  117.  
  118. Creating The Library
  119.  
  120. *   CRTLIB GENESIS _
  121. *   TEXT('Genesis Software Library')
  122.  
  123.   (Note: The underscore ("_") character indicates the continuation of the same 
  124. command on an additional line. Do not include the "_" character  when actually 
  125. entering and executing the command on the AS/400.)
  126.  
  127.   All but two of the permanent objects and source code files will need to be installed in 
  128. a single library on your AS/400. Try to use the library name GENESIS if possible. In 
  129. the examples in this document, the library name GENESIS is used. If you decide to 
  130. install to a different library, substitute the name you used were the GENESIS library is 
  131. referenced.
  132.  
  133. Creating The QGPL REXX Source File
  134.  
  135. *   CRTSRCPF FILE(QGPL/SRCREX) _
  136. *   SIZE(*NOMAX) _
  137. *   TEXT('Genesis REXX Source Code')
  138.  
  139. *   COPY C:\GENESIS\AS400API\SOURCE\SROBJ.REX _
  140. *   QGPL/SRCREX(SROBJREX)
  141.  
  142.   (Note: The COPY command is not actually an AS/400 command; it indicates that 
  143. you must copy the source code referenced (in this case SROBJ.REX) from your 
  144. personal computer to the AS/400 source file indicated -- in this case 
  145. QGPL/SRCREX(SROBJREX).)
  146.  
  147.   You can use any file transfer product that supports uploading of source member 
  148. records from your personal computer to the AS/400 to copy SROBJ.REX to the 
  149. AS/400. If you do not have such a utility, you can always key the file in by hand using 
  150. SEU (ouch!).
  151.  
  152.   This REXX source code is used by the SROBJ program to restore objects from your 
  153. PC to the AS/400. Be sure that when you run SROBJ that it references the REXX 
  154. option in the library QGPL.
  155.  
  156. Restoring AS/400 Objects
  157.  
  158. You can use the SROBJ.EXE utility program provided to restore the objects required. 
  159. You can use his utility only if you have copied the REXX source code to 
  160. QGPL/SRCREX, as described above. Be sure that the SROBJ settings point to the 
  161. REXX option and the QGPL library is referenced as holding the source.
  162.  
  163.   Once you have restored SROBJRPG program (SROBJRPG.V23) you may change 
  164. SROBJ to use the RPG server option, which is much faster. For more information 
  165. about what each Save File Image (*.V23) contains, see the list below.
  166.  
  167.   SAVF Image, Description
  168.  
  169.   ECHOCBL.V23, ECHOCBL program required by ECHO
  170.   PINGRPG.V23, PINGRPG program required by PING
  171.   SROBJRPG.V23, SROBJRPG program required by SROBJ
  172.  
  173.   (Note: Genesis Software offers a product, Genesis Objex, which is a commercial 
  174. quality version of SROBJ. It includes many enhancements such as file compression, 
  175. drag and drop, faster processing, and no requirement for pre-existing source code or 
  176. objects on the AS/400. It uses built-in CA/400 and DDM services found on all 
  177. AS/400s.
  178.  
  179.   Genesis Objex also does not require the support of the remote command and file 
  180. transfer API interfaces. All that is required is an APPC-complaint router that supports 
  181. the EHNAPPC.DLL interface.)
  182.  
  183.   All the objects stored in the SAVF images referenced above were saved from the 
  184. GENESIS library on an AS/400 at V2R3M2. When saved, the objects were assigned 
  185. *ALL *PUBLIC authority and the owner was QUSER. After they are restored to your 
  186. system you can change the security options as your installation needs warrant.
  187.  
  188. Creating Programs
  189.  
  190. If you are unable to restore the SAVF images to the GENESIS library with the SROBJ 
  191. utility, you can create the required server programs required by using the standard 
  192. AS/400 utilities. Of course, you must upload the source members beforehand or 
  193. entered them in using SEU (ouch, again!). All the programs are listed below, along 
  194. with the corresponding PC file (found in the ..\SOURCE directory) that contains the 
  195. source code, and a description of the program.
  196.  
  197.   Program, Source Code, Description
  198.  
  199.   ECHOCBL,  ECHO.CBL,  Echo COBOL Program
  200.   PINGRPG,  PING.RPG,  Ping RPG Program
  201.   SROBJRPG,  SROBJ.RPG,  Save/Restore Server RPG Program
  202.  
  203. Creating The GENESIS Output Queue
  204.  
  205. *   CRTOUTQ OUTQ(GENESIS/GENESIS) _
  206. *   TEXT('Genesis Output Queue')
  207.  
  208.   You can create the GENESIS output queue in the GENESIS library. This output 
  209. queue is not required for any program to work, but is handy if you want to set up a 
  210. user profile that references output queue. You might use this output queue to make it 
  211. easier to locate spooled output that is generated while you are testing the programs 
  212. provided.
  213.  
  214. Creating ICF Files AND Device Entries
  215.  
  216. *   CRTICFF FILE(GENESIS/ECHOICF) _
  217. *   SRCFILE(GENESIS/SRCICF)
  218.  
  219. *   ADDICFDEVE FILE(GENESIS/ECHOICF) _
  220. *   PGMDEV(ECHOICF) _
  221. *   RMTLOCNAME(*REQUESTER) _
  222. *   CNVTYPE(*USER)
  223.  
  224. *   CRTICFF FILE(GENESIS/PINGICF) _
  225. *   SRCFILE(GENESIS/SRCICF)
  226.  
  227. *   ADDICFDEVE FILE(GENESIS/PINGICF) _
  228. *   PGMDEV(PINGICF) _
  229. *   RMTLOCNAME(*REQUESTER) _
  230. *   CMNTYPE(*APPC)
  231.  
  232.   The APPC Basic Conversion Demonstration Program (ECHO) and the APPC 
  233. Mapped Conversation Demonstration program (PING) require the existence of the 
  234. ICF files and device entries shown above. To create these ICF files and device 
  235. entries, enter the commands show above.
  236.  
  237. The GENESIS Library
  238.  
  239.   After you complete the setup process or the manual steps to create and set up the 
  240. GENESIS library, you should find the following objects in GENESIS.
  241.  
  242.     Object, Type, Description
  243.  
  244.     ECHOCBL,  *PGM (CBL),  Echo Cobol Program
  245.     PINGRPG,  *PGM (RPG),  Ping RPG Program
  246.     SROBJRPG,  *PGM (RPG),  Save/Restore Server RPG Program
  247.     GENESIS,  *OUTQ,  Genesis Output Queue
  248.     ECHOICF,  *FILE (ICFF),  Echo ICF File
  249.     PINGICF,  *FILE (ICFF),  Ping ICF File
  250.  
  251. Omitting The AS/400 Setup
  252.  
  253. Since you are manually setting up the client/server configuration, something that 
  254. happens automatically if you purchase the book and it's companion diskettes, several 
  255. INI files will not be properly built. These INI files need references to the AS/400 library 
  256. and programs, which must be installed for them to execute properly.
  257.  
  258.   If you attempt to run a program and a message tells you that a certain INI file has 
  259. not been set up, you need to manually place the proper entries into the INI file after 
  260. you have installed the Server components on your AS/400. You must remember that 
  261. many of the programs install on your PC rely on AS/400 counterparts to do their work; 
  262. if they have not been installed, the programs cannot function!
  263.  
  264.   For example, the PING and ECHO programs found in the ..\APPC directory both use 
  265. the APPC.INI file. Each section within the INI file has a System= and Library= entry. If 
  266. you install the AS/400 objects during the setup process to an AS/400 named 
  267. BIGBLUE in library GENESIS2, the following entries, along with others, would be 
  268. found:
  269.  
  270.     [ECHO]
  271.     System=BIGBLUE
  272.     Library=GENESIS2
  273.  
  274.     [PING]
  275.     System=BIGBLUE
  276.     Library=GENESIS2
  277.  
  278. V3R1 Changes To Shared Folders
  279.  
  280. Beginning with V3R1, IBM has introduced a new file system known as the Integrated 
  281. File System (IFS). This change has a direct effect on shared folder functionality. 
  282. Before V3R1, all objects, including shared folders, originated from the QSYS OS/400 
  283. library.
  284.  
  285.   The IFS introduces a layer on top of QSYS, making it just another entry in the "root". 
  286. The propose of the IFS is too allow the AS/400 to service various file systems and 
  287. prepare it for the future as IBM's "Server Of Choice". Hey, I'm excited! The IFS 
  288. enables IBM to add new hardware and software, such as the FSIOP and UNIX 
  289. compliant file systems. The IFS is intended to provide a common interface to all the 
  290. objects on the AS/400.
  291.  
  292.   In many cases, if you are not aware of the IFS, you'd never miss it. In fact, if you 
  293. have a CA/400 client that is running pre-V3R1 code, you will not be able to access 
  294. any of the new V3R1 code and files that reside in the new IFS layer below QSYS. 
  295. That is why IBM provided a migration aid that allows your pre-V3R1 client to access 
  296. the required files and data found within the IFS by coping them to shared folders.
  297.  
  298.   With V3R1, the "root" shared folder is now designated as part of the QDLS 
  299. (document and library services) file system (more on that in a minute); so the shared 
  300. folder mappings shown below are equivalent.
  301.  
  302.   F: \\BIGBLUE\QIWSTOOL (Pre-V3R1)
  303.   F: \\BIGBLUE\QDLS\QIWSTOOL (V3R1)
  304.  
  305.   Be aware that with V3R1, when IBM refers to a directory such as QPWXCWN (new 
  306. CA/400 code), it is referencing the \QPWXCWN folder and not the 
  307. \QDLS\QPWXCWM folder (used for PTFs and temporary code).
  308.  
  309.   IBM has provided new commands that allow you to work with the IFS from the 
  310. AS/400 command line. These include the CPY command, which functions like the 
  311. PC's COPY or XCOPY command; and the MD command, which -- like its PC 
  312. counterpart -- creates subdirectories.
  313.   
  314.   The commands shown below demonstrate the copying of Windows client files to 
  315. shared folders which would be accessible by pre-V3R1 clients.
  316.  
  317.   MD DIR('/QDLS/CAMIGRAT')
  318.   MD DIR('/QDLS/CAMIGRAT/MRI2924')
  319.   CPY OBJ('/QPWXCWN/*') TODIR('/QDLS/CAMIGRAT')
  320.   CPY OBJ('/QPWXCWN/MRI2924/*') TODIR('/QDLS/CAMIGRAT/MRI2924')
  321.  
  322.   With V3R1, the familar AS/400 library is just another entry in the IFS and you always 
  323. have a current location (library) within the IFS structure. Your AS/400 user profile 
  324. determines your default home location which will be your current library when you first 
  325. signon.
  326.  
  327.   The IFS will eventually offer seven unique file systems; including the "root" system, 
  328. the QLANSrv system, the QOpenSys system, the QSYS.LIB system, and the QDLS 
  329. system. The QFileSvr.400 and QOPT (optical disk) file systems will not be available 
  330. until V3R6. The "root" system supports directory and file names up to 256 characters 
  331. in length and names are not case sensitive. The QOpenSys supports the same file 
  332. name length as "root", but names are case sensitive. QSYS.LIB contains all the 
  333. familiar OS/400 objects. Each library appears as a subdirectory under the QSYS.LIB 
  334. object. QSYS.LIB supports a 10.6 naming convention. The QDLS file system 
  335. supports DLO (document library objects) and shared folders. It supports a 8.3 naming 
  336. convention. The QLANSrv system provides support for the new FSIOP offerings.
  337.  
  338.   New IFS APIs are available for working with the various file systems referenced 
  339. above. "Using VB With CA/400 APIs" only deals with shared folders support (QDLS). 
  340. Hey, I had to leave something for volume 2! Anyway, I was given a 700 page limit!
  341.  
  342. Confirm After Allocate Required
  343.  
  344. In some cases, it may be necessary to issue a call to the EHNAPPC_Confirm API 
  345. directly after an allocation to insure that the APPC conversation is in "synch". Using 
  346. the API addresses a problem you might encounter. After you allocated a conversation 
  347. and attempt to send data to the AS/400 program, everything may appear to be OK but 
  348. no data is received by the AS/400 program. If you run across this problem, calling the 
  349. EHNAPPC_Confirm API, before sending the data, might help clear it up. See the 
  350. zzCAConfirm wrapper in ZZPAPW2.BAS for an example of using 
  351. EHNAPPC_Confirm.
  352.  
  353. ICF Entries For Basic And Mapped Conversations
  354.  
  355. One common error that people make when they are setting up the ICF device entry 
  356. required to execute APPC conversation if the incorrect entry of parameters for the 
  357. ADDICFDEVE command. Dependent on whether you are setting up support for a 
  358. basic or mapped conversation the value will be different. Consider the examples 
  359. below.
  360.  
  361.     ADDICFDEVE FILE(GENESIS/ECHOICF) PGMDEV(ECHOICF) _
  362.     RMTLOCNAME(*REQUESTER) CNVTYPE(*USER)
  363.  
  364.     ADDICFDEVE FILE(GENESIS/PINGICF) PGMDEV(PINGICF) _
  365.     RMTLOCNAME(*REQUESTER) CMNTYPE(*APPC)
  366.  
  367.   The first entry is for a basic conversion because the conversation type (CNVTYPE) 
  368. parameter has been set to *USER. This means that the user-written program will 
  369. have handle the header/error information. The second example shows the correct 
  370. entry for an APPC conversation. Note that the CNVTYPE parameter is omitted and 
  371. the communications type (CMNTYPE) parameter is specified as *APPC. This 
  372. indicates that the "mapping" of the header/error information will be handled 
  373. automatically by APPC support.
  374.  
  375. Close Before Ending Transfer Request
  376.  
  377. Although the IBM documentation would suggest that after you perform a transfer 
  378. request you can end the conversation and any open files will be closed, I have found 
  379. that this sometimes leads to errors. This is especially true when doing uploads. I 
  380. recommend that after you complete a file transfer, you always close the file by calling 
  381. the zzTFClose wrapper before calling the zzTFEndConversation wrapper.
  382.  
  383. Notes About Version Checking And Stamping
  384.  
  385. The ODVERCHK program allows you to address problems that can  occur when 
  386. version stamping is not done properly and how it can make your life difficult. This 
  387. section presents examples of some of the problems that might occur. This section will 
  388. definitely put the "fear of software" into your heart.
  389.  
  390.   Suppose vendor A and B use a common DLL named COMMON.DLL in their 
  391. products. Maybe its a DLL that contains great sort routines. Vendor A has been 
  392. working on its product for three years (must be an IBM spin-off company) and is 
  393. stilling using version 1.0 of COMMON.DLL.
  394.  
  395.   Vendor B has produced a product which also uses COMMON.DLL, but has kept up 
  396. to date by developed their product using version 2.0 (the latest version). When you 
  397. buy vendor B's product and when you run their setup/installation, COMMON.DLL 
  398. (version 2.0) is installed in your Windows system (e.g., C:\WINDOWS\SYSTEM) 
  399. directory. So far, everything is cool!
  400.  
  401.   Now you buy Vendor A's product and run the setup/installation for it. Some time 
  402. during the setup/installation process, COMMON.DLL must be installed. Several 
  403. scenarios are possible at this point -- most of them are bad!
  404.  
  405.   If Vendor A is a "responsible" vendor, its setup/installation program will be smart 
  406. enough to recognize that a more recent version of COMMON.DLL is already installed 
  407. in C:\WINDOWS, and it will do nothing. No problem here, maybe (see below). But the 
  408. setup might be "stupid" and copy the older version of COMMON.DLL over the top of 
  409. version 2. This causes no problems for Vendor A's product, it was designed to work 
  410. with version 1.0. So Vendor A has nothing to worry about. But what happens when 
  411. you try to run Vendor B's program? If your lucky, its program will also work with 
  412. version 1.0. But if Vendor B's product requires an API or function that was introduced 
  413. with version 2.0 of COMMON.DLL -- you guessed it -- Vendor B's product is dead in 
  414. the water!
  415.  
  416.   Another possible scenario is that Vendor A's setup program installs version 1.0 of 
  417. COMMON.DLL into another directory (e.g., C:\WINDOWS), or in the directory where 
  418. the program is installed. Now you have two versions of the same DLL on your system 
  419. and depending on how you have your PATH set up; the programs from vendor A and 
  420. B may or may not work.
  421.  
  422.   Vendor A's setup program may be smart enough not to install version 1.0 of 
  423. COMMON.DLL, because it sees a more recent version 2.0 of COMMON.DLL is 
  424. already installed. Vendor A's setup program is saying "OK, I see a newer version 
  425. (2.0) of COMMON.DLL, so I'll use it instead of my older 1.0 version". This is great if 
  426. the developer of COMMON.DLL has not introduced any incompatibilities between 
  427. version 1.0 and 2.0. Version 1.0 will be left on Vendor A's setup disk and only version 
  428. 2.0 will be on your hard drive. But what if COMMON.DLL version 2.0 does not support 
  429. programs written to use COMMON.DLL version 1.0. Now we have real problems! 
  430. Vendor B's program still works fine. Remember it was developed to use version 2.0 of 
  431. COMMON.DLL, which was installed when you installed Vendor B's product. But 
  432. Vendor A's program, that you just installed, won't work because it was designed to 
  433. use version 1.0 of COMMON.DLL. Vendor A has followed all the rules (other than not 
  434. keeping up with changing versions of COMMON.DLL) but now their program won't 
  435. run. This scenario is rare, but not unknown. Have you had problems with 
  436. THREED.VBX or GRID.VBX? Now you understand why developers are so concerned 
  437. with maintaining backward compatibility of files such as our example COMMON.DLL.
  438.  
  439.   Another problem might occur if the different versions of COMMON.DLL have no 
  440. version information. How do you know know version is which? You can't always go by 
  441. the dates of files, because these can be easily changed. Basically, you're out of luck 
  442. in this situation. Unfortunately, this situation happens much to often. For example, 
  443. IBM doesn't even version stamp its CA/400 DLLs! Write your congress person now! 
  444. Being able to keep files straight when they have no version information is a hit-or-
  445. miss proposition.
  446.  
  447.   To add more fuel to the fire, what happens if another component provider decides to 
  448. provide a great new DLL that does all kinds of neat things, and they decide to name 
  449. their new component -- you guessed it -- COMMON.DLL! Then Vendor C develops a 
  450. new product using this other COMMON.DLL component. The fun really begins when 
  451. you install Vendor C's product!
  452.  
  453.   I warned you before you started reading this section! Don't worry, I'm sure your files 
  454. are all correct, and your using the most up to date available!
  455.  
  456. Using the WPS.EXE Utility
  457.  
  458. In addition to the ODCHKVER.EXE, supplied with the companion diskettes, a VB 
  459. utility that you might find very helpful is WPS.EXE. This program, installed with VB, 
  460. can be found in the \VB\CDK directory. It displays a map of all programs and DLLs 
  461. loaded into your PC's memory. This information is very useful in determining which 
  462. DLLs are actually being used by Windows, and your programs.
  463.  
  464. Using Basic DOS Support With Windows 95
  465.  
  466. It is possible to use the basic (not extended) version of PCS/400 with Windows 95. 
  467. Remember that you will be unable to use any of the APIs because they all require that 
  468. the extended DOS router be running. If you have upgraded to V3R1M1, see "Using 
  469. CA/400 With Windows 95" below.
  470.  
  471.   Here are the steps required to setup configuration diskettes that let you install DOS 
  472. basic support on a Windows 95 PC. To perform the tasks outline, you must have a 
  473. PC that is using PCS/400.
  474.  
  475.     Use the PC Support Administration Program (PCSWADM.EXE) to create a 
  476. configuration using the basic DOS option. You will need 4 or 5 formatted diskettes 
  477. (HD) to create a complete install set. Follow the instructions provided by 
  478. PCSWADM.EXE.
  479.  
  480.     On the Windows 95 PC, access the Control Panel (available through the Start 
  481. menu) and select the Network icon. Click the Add button under configuration. Choose 
  482. protocol and once again click the Add button. Choose Microsoft and MSDLC. The 
  483. MSDLC protocol will be loaded into Windows 95, but we still need to make changes to 
  484. the AUTOEXEC.BAT file for basic DOS services.
  485.  
  486.     Open a DOS window and make a backup copy of AUTOEXEC.BAT, CONFIG.SYS, 
  487. STARTPCS.BAT. Then run the CA/400 install from the diskettes that you created 
  488. earlier. Normally, the install would go to the C:\PCS directory. Remove all changes 
  489. made by the install (copy the backup versions of the files to the changed originals). 
  490. You will need to make the changes shown below.
  491.  
  492.       Be sure that your CONFIG.SYS has, at a minimum, the following entries:
  493.  
  494.         DOS=HIGH
  495.         DOS=UMB
  496.         FILES=99
  497.         DEVICE=C:\PCS\EIMPCS.SYS
  498.  
  499.       Be sure that your AUTOEXEC.BAT has, at a minimum, the following entries:
  500.  
  501.         PATH=...C:\PCS;
  502.         C:\WINDOWS\MSDLC.EXE
  503.         C:\PCS\STARTPCS
  504.  
  505.     C:\PCS must be somewhere within your path statement. MSDLC must be run after 
  506. you have initialized your network connection but before you log on. Dependent on 
  507. your network, you may need to play with this one to get it right.
  508.  
  509.     Be sure that your STARTPCS.BAT file has no reference to shared folders, the 
  510. update function, virtual printing, or data queues. Sorry, they don't work. Basically, all 
  511. you need is the STARTRTR command (which you may just move to the 
  512. AUTOEXEC.BAT file if you wish).
  513.  
  514.   After restarting your computer the following functions should (notice I said should!) 
  515. work:
  516.  
  517.     PC Support Administration (PCSWADM)
  518.     PC Support Menu (PCSMENU)
  519.     File Transfer (both ways)
  520.     PC to AS/400 file transfer
  521.     The workstation function
  522.     Rumba terminal emulation
  523.     Rumba printing.
  524.  
  525.     The workstation function (WSF.EXE) works, but if you end it and try to execute it 
  526. again it will fail. Although Rumba will work, the fast path, auto connect, and session 
  527. configuration options will not function.
  528.  
  529.     You'll need to install, set the connection type to "PC Support", and save the 
  530. configuration. Use the saved configuration as a shortcut on the Windows 95 task bar. 
  531. You'll have to click Session/Connect each time you start Rumba.
  532.  
  533.   Remember that IBM does not support this kludgy configuration, so don't expect any 
  534. help from BIG BLUE. Whoops, I forgot; they can't use the BIG BLUE reference 
  535. anymore<G>!
  536.  
  537.   Good luck and may the force be with you! Hey get to V3R1M1 as soon as possible!
  538.  
  539. Using CA/400 With Windows 95
  540.  
  541. As this book was being prepared for publication, I was attempting to get the CA/400 
  542. V3R1M1 client code to work within the Windows 95 environment. Although my 
  543. success has been mixed up, I thought I'd shared with you information provided to me 
  544. by IBM. This information mighthelp you to use the CA/400 For Windows 3.1 client in 
  545. Windows 95 successfully. 
  546.   
  547.   Remember that IBM does not support the use of its clients in the Windows 95 
  548. environment. All the information below is strictly beta work. To have any hope of 
  549. success, you must use the V3R1M1 CA/400 For Windows 3.1 client. DO NOT try this 
  550. configuration within a production environment unless you are looking for a career 
  551. change!
  552.  
  553.   The following PTFs need to be applied to your V3R1 system:
  554.  
  555.     APAR, PTF, File
  556.  
  557.     SA46324, SF25773, VREFLECT.386
  558.     SA46342, SF25785, EHNSFW.DLL
  559.     SA46100, SF25550, VNCD.386
  560.     3600058, SF25251, NOFNSD.DLL
  561.     3992942, SF25788, EHNEC.DLL
  562.     GUI/400, SF26463
  563.  
  564.   After applying the PTFs, you need to copy the files listed above to your CA/400 
  565. directory on your personal computer. If you are doing a new install of CA/400 For 
  566. Windows 3.1 on your Windows 95 PC, you must first apply the PTFs to your AS/400 
  567. and build a new set of install diskettes from the AS/400 that will automatically include 
  568. the fixes. This can be done by running the CA/400 administration program on any 
  569. currently functioning CA/400 For Windows 3.1 client PC.
  570.  
  571.   Another possibility is that you have already installed Windows 95 onto a PC that has 
  572. CA/400 for Windows 3.1 installed on it, and the PC currently does not work. If this is 
  573. the case, you can copy the fix files from the AS/400 using shared folders on a 
  574. different PC where Windows 3.1 is installed, and then manually copy the files to the 
  575. Windows 95 PC into the CA/400 directory (normally C:\CAWIN).
  576.  
  577.   For the LAN based router, you can use either the IBM LAN Support Program or the 
  578. Microsoft DLC (MSDLC is available on the NEWS/400 CompuServe Forum) and the 
  579. following steps must be taken:
  580.  
  581.     Using the IBM LAN Support Program (not recommended)
  582.  
  583.       Disable all networking functions in Windows 95 by
  584.  
  585.         1. Select Start
  586.         2. Select Settings
  587.         3. Select Control Panel
  588.         4. Select Network
  589.         5. For all installed components select the component
  590.             and select the REMOVE button.
  591.  
  592.     OR
  593.  
  594.     Using the Microsoft DLC driver (recommended) 
  595.     
  596.       1. Select Start
  597.       2. Select Settings
  598.       3. Select Control Panel
  599.       4. Select Network
  600.       5. Select Protocol
  601.       6. Select ADD Button
  602.       7. Select Microsoft
  603.       8. Select Microsoft DLC and press OK
  604.       9. On the main network control panel 
  605.           dialog select Microsoft DLC
  606.  
  607.          With in Advanced tab window, select properties, and
  608.          set the following parameters:
  609.  
  610.            SAPS=8
  611.            STATIONS=20
  612.            xsaps0=5
  613.            xstations0=5
  614.  
  615.     If you are using the IBM Token-ring Adapter you must modify the default transmit 
  616. buffer size as follows:
  617.  
  618.       1. Select Control Panel
  619.       2. Select Network
  620.       3. Select IBM Token-ring card Properties
  621.       4. Select the advanced TAB
  622.       5. Change the Transmit Buffer Size from 1024 to 2040
  623.  
  624.   A manual entry in your Windows WIN.INI configuration file is required. Open the file 
  625. using any text editing utility, such as NOTEPAD, and add the following entry into the 
  626. existing [ModuleCompatibility] section:
  627.  
  628.     LANNSD=0x0001
  629.  
  630.   With this configuration, certain restrictions do apply, including:
  631.  
  632.     1. The Graphical Access/400 function of Client Access/400 does not currently
  633.         work. A PTF will be forth coming to correct this.
  634.  
  635.     2. If you Install Client Access/400 for Windows 3.1 to a new Windows 95 PC
  636.         without the fixes on the install diskettes, the install will fail.
  637.  
  638.     3. When installing the Rumba/400 function from the Setup program, no icons will
  639.         be created. This can be corrected by the following steps.
  640.  
  641.       a. Select Start/Settings/Taskbar
  642.       b. Select Start Menu Programs / Advanced
  643.       c. Select Programs
  644.       d. Select menu item File/New/Folder
  645.       e. Type "Client Access 400 Rumba" as the folder name
  646.       f. Double click on "Client Access 400 Rumba"
  647.       g. In the empty contents section click your right mouse button
  648.       f. Select New/Shortcut from the menu bar
  649.       h. Select Browse RUMBACAW
  650.       i. Select RUMBAWSF.EXE for "Rumba - Terminal"
  651.       g. Push the Next button
  652.       h. Name the Icon "Rumba - Terminal" and push the finish button
  653.  
  654.       Repeat steps g-h for the following applications:
  655.         RUMBAPRN.EXE for "Rumba - Print"
  656.         RUMBA.EXE for "Rumba - Main"
  657.  
  658.       i. Select main menu option File/Close
  659.       j. Push the OK button on the taskbar properties
  660.  
  661.     To run Rumba function from the main Start menu select the "Client Access 400
  662.     Rumba" menu, and your desired icon.
  663.  
  664.     4. Microsoft's DLC does not function properly with certain Pentium machines. Do
  665.         not assume that MSDLC is not the cause of any problem you might experience.
  666.  
  667.   (Note: I've had reports that Microsoft support is telling people all they need to run 
  668. CA/400 within Windows 95 is an updated version of a file named NOFNSD.DLL. 
  669. According to IBM this is not true and they are telling the truth. Microsoft is also 
  670. claiming that Basic DOS PC Support will work under Windows 95. While this is true, 
  671. IBM says they will not support it and that only the updated Windows V3R1M1 client 
  672. (available 1996) will be officially supported.)
  673.  
  674.   (Note: One problem that you may encounter with Windows 95, if you are using 
  675. Novell SAA, is a message that the IPX/SPX support is not started. If you are using the 
  676. 32-bit Novell client this is possible since it is loaded as a virtual device driver (VxD) 
  677. after AUTOEXEC.BAT has been run. You can overcome this limitation by moving the 
  678. AUTOEXEC.BAT code, related to start the router, to WINSTART.BAT in the 
  679. WINDOWS directory. The commands in this file are executed after the VxDs are 
  680. loaded; so IPX/SPX support will be "seen" by the STRNRTR.EXE and PCSWIN.)
  681.  
  682.   Good luck!
  683.  
  684. WWW Sites
  685.  
  686. The following list includes additional WWW sites that might be of interest to AS/400 
  687. developers and users.
  688.  
  689. Duke Communications International
  690. http://www.duke.com/
  691.  
  692. IBM AS/400 Home Page
  693. http://as400.rochester.ibm.com/
  694.  
  695. IBM AS/400 Services
  696. http://as400.rochester.ibm.com/QDLS/400home/service/serv_m.htm/
  697.  
  698. IBM Book Ordering
  699. http://booksrv2.raleigh.ibm.com/
  700.  
  701. IBM Personal Software Services
  702. http://ps.software.ibm.com/
  703.  
  704. IBM Global Network
  705. http://www.ibm.net/
  706.  
  707. IBM Home Page
  708. http://www.ibm.com/
  709.  
  710. IBM Networking Home Page
  711. http://www.raleigh.ibm.com/
  712.  
  713. IBM Red Books
  714. http://www-i.almaden.ibm.com/redbooks/
  715.  
  716. Netsoft
  717. http://www.netsoft.com/
  718.  
  719. ShowCase
  720. http://www.bismark.com/showcase/
  721.  
  722. Some Thoughts
  723.  
  724. First of all, if you've been waiting for this file since the Chicago COMMON -- my 
  725. apologies. I have included a few personal thoughts about AS/400 client/server 
  726. application development.
  727.  
  728.   In the world of AS/400 client/server computing there are many ways to "skin a cat". 
  729. People are always asking me what the best solution is; or what is the best way to 
  730. design an application. I tell them there are a number of ways most applications can be 
  731. done -- this is always true. I have found; however, that the most robust, reliable 
  732. applications that I have developed rely on APPC itself.
  733.  
  734.    The scenario of a developer written client program (that for me is almost always VB 
  735. with a pinch of Visual C++ and Delphi) and a developer written server program (that 
  736. for me is almost always RPG) communicating through APPC APIs can't be beat for 
  737. performance and reliability. True, these solutions are generally more complicated to 
  738. code and implement; but once you've got them working, they are very solid.
  739.  
  740.   Remember that almost all the other APIs use APPC to communicate and they rely 
  741. on IBM provided utilities and servers to "ride the APPC wave". That convenience 
  742. comes at a price -- less performance and lack of control over specific features of your 
  743. application.
  744.  
  745.   ODBC is promising and you can do some great stuff with it. But the QSYS file 
  746. system, at this point, just does not always match up well ODBC. With V3R1, IBM has 
  747. done a lot to change that. But why do you think IBM is introducing all these new file 
  748. systems into the AS/400? Think about it!
  749.  
  750.   Over the next year, I see myself continuing to write both the client and server 
  751. components for new applications. I'll probably move toward CPI-C since it provides a 
  752. slightly cleaner interface than APPC. TCP/IP will also be playing a greater role in what 
  753. I do. The new object management APIs are neat and I've played with them some. But 
  754. they really don't do much for normal applications that don't do much generic stuff with 
  755. AS/400 objects but almost always deal with manipulating data. I'm doing more work 
  756. with the built-in support provided by IBM's DDM servers and have managed to do 
  757. some exciting stuff. A lot of the functionality of Genesis Objex relies on the 
  758. capabilities within DDM.
  759.  
  760.   I'm anxious to look at the new 32-bit support IBM, and others, will provide for 
  761. Windows. That's were the cooperate world will be heading -- none to slowly. I'm a big 
  762. believer in Windows NT and IBM has got to get on the bandwagon with it. I've already 
  763. seen some movement by IBM in that direction. 32 bit development is were it's at now, 
  764. or will be very shortly. I'll be learning more about VB 4.0 over the next year. Borland 
  765. will shortly be coming out with their 32-bit Delphi product. I plan to use Delphi more 
  766. over the next year. Mainly in applications were I don't want the overhead of the OLE 
  767. baggage that VB 4.0 carries.
  768.  
  769.   The AS/400 is a marvelous machine; rock solid. If the shops I do work for had 
  770. AS/400s that were as unreliable as the LANs and WANs that surround them, then 
  771. many an AS/400 professional would be "sleeping with the fishes" today. You can 
  772. bellow all you want about this fact, say forget those PC toys, but the big picture is that 
  773. LANs, WANs, and PCs are here to stay. Don't doubt that for a second. They will be 
  774. the players; and if IBM can have the AS/400 become a valuable, stable, resource-
  775. filled component in that world then they've got something.
  776.  
  777.   Today, I believe the future of the AS/400 in a client/server world is getting brighter. 
  778. Anyone who knows me will tell you I didn't feel that way not to long ago. Good luck in 
  779. your endeavors trying to make the AS/400 work for your client/server applications!
  780.  
  781.   I hope the sample programs provided you with some good basic (no pun intended) 
  782. examples of AS/400 client/server programs. 
  783.  
  784. Ron Jones, CCP
  785. Genesis Software
  786.  
  787. Genesis Software
  788.  
  789.   Feel free to distribute the COMMONVB.ZIP file to whomever. It's free for the using. 
  790. Just remember that all the code comes with no guarantees; so check out your 
  791. programs that use the code very carefully. By the way, we do sell code and programs 
  792. that we guarantee will work. For more information about Genesis Software and the 
  793. products and services we provide contact:
  794.  
  795.   Genesis Software, Inc.
  796.   2709 Penny Lane
  797.   McKinney, Texas 75070
  798.   CompuServe: 75070,2615
  799.  
  800. ..Ron Jones
  801.  
  802. Description For Forum Upload of COMMONVB.TXT
  803.  
  804. 12/24/95 update to text file describing the purpose and contents of the 
  805. COMMONVB.ZIP file. This file also contains information about the downloading and 
  806. installation of the COMMONVB.ZIP file. Ron Jones.
  807.  
  808. VB CA400 APIS API AS400 CLIENT ACCESS GUI
  809.  
  810. Description For Forum Upload of COMMONVB.ZIP
  811.  
  812. 12/24/95 update for zipped file containing sample programs and information about 
  813. using VB to develop AS400 client/server applications. Enjoy! Ron Jones.
  814.  
  815. VB CA400 APIS API AS400 CLIENT ACCESS GUI
  816.  
  817.  
  818.  
  819.  
  820.  
  821.